parameter_defaults:
  UndercloudExtraConfig:
    ironic::disk_utils::image_convert_memory_limit: 2048
    ironic::conductor::heartbeat_interval: 20
    ironic::conductor::heartbeat_timeout: 120

    # Ironic defaults to using `qemu:///system`.  When running libvirtd
    # unprivileged we need to use `qemu:///session`.  This allows us to pass
    # the value of libvirt_uri into /etc/ironic/ironic.conf.
    ironic::drivers::ssh::libvirt_uri: '{{libvirt_uri}}'

    # The following are configurations for the different workers for the undercloud
    # services.
    {% if undercloud_workers is defined -%}
    undercloud_workers: {{undercloud_workers}}
    {%- endif %}

    {% if undercloud_glance_workers is defined -%}
    glance::api::workers: {{undercloud_glance_workers}}
    glance::registry::workers: {{undercloud_glance_workers}}
    {% elif undercloud_workers is defined -%}
    glance::api::workers: "%{hiera('undercloud_workers')}"
    glance::registry::workers: "%{hiera('undercloud_workers')}"
    {%- endif %}

    {% if undercloud_heat_workers is defined -%}
    heat::api::workers: {{undercloud_heat_workers}}
    heat::api_cfn::workers: {{undercloud_heat_workers}}
    heat::engine::num_engine_workers: {{undercloud_heat_workers}}
    {% elif undercloud_workers is defined -%}
    heat::api::workers: "%{hiera('undercloud_workers')}"
    heat::api_cfn::workers: "%{hiera('undercloud_workers')}"
    heat::engine::num_engine_workers: "%{hiera('undercloud_workers')}"
    {%- endif %}

    {% if undercloud_ironic_workers is defined -%}
    ironic::api::workers: {{undercloud_ironic_workers}}
    ironic::wsgi::apache::workers: {{undercloud_ironic_workers}}
    {% elif undercloud_workers is defined -%}
    ironic::api::workers: "%{hiera('undercloud_workers')}"
    ironic::wsgi::apache::workers: "%{hiera('undercloud_workers')}"
    {%- endif %}

    {% if undercloud_keystone_workers is defined -%}
    keystone::wsgi::apache::workers: {{undercloud_keystone_workers}}
    {% elif undercloud_workers is defined -%}
    keystone::wsgi::apache::workers: "%{hiera('undercloud_workers')}"
    {%- endif %}

    {% if undercloud_neutron_workers is defined -%}
    neutron::agents::metadata::metadata_workers: {{undercloud_neutron_workers}}
    neutron::server::api_workers: {{undercloud_neutron_workers}}
    {% elif undercloud_workers is defined -%}
    neutron::agents::metadata::metadata_workers: "%{hiera('undercloud_workers')}"
    neutron::server::api_workers: "%{hiera('undercloud_workers')}"
    {%- endif %}

    {% if undercloud_nova_workers is defined -%}
    nova::api::metadata_workers: {{undercloud_nova_workers}}
    nova::api::osapi_compute_workers: {{undercloud_nova_workers}}
    nova::conductor::workers: {{undercloud_nova_workers}}
    nova::scheduler::workers: {{undercloud_nova_workers}}
    {% elif undercloud_workers is defined -%}
    nova::api::metadata_workers: "%{hiera('undercloud_workers')}"
    nova::api::osapi_compute_workers: "%{hiera('undercloud_workers')}"
    nova::conductor::workers: "%{hiera('undercloud_workers')}"
    nova::scheduler::workers: "%{hiera('undercloud_workers')}"
    {%- endif %}

    {% if undercloud_nova_max_concurrent_builds is defined -%}
    nova::compute::ironic::max_concurrent_builds: {{undercloud_nova_max_concurrent_builds}}
    {%- endif %}

    {% if undercloud_nova_rpc_response_timeout is defined -%}
    nova::rpc_response_timeout: {{undercloud_nova_rpc_response_timeout}}
    {%- endif %}

    {% if undercloud_ironic_rpc_response_timeout is defined -%}
    ironic::rpc_response_timeout: {{undercloud_ironic_rpc_response_timeout}}
    {%- endif %}

    {% if undercloud_ironic_power_state_change_timeout is defined -%}
    ironic::conductor::power_state_change_timeout: {{undercloud_ironic_power_state_change_timeout}}
    {%- endif %}


    {% if undercloud_swift_workers is defined -%}
    swift::proxy::workers: {{undercloud_swift_workers}}
    {% elif undercloud_workers is defined -%}
    swift::proxy::workers: "%{hiera('undercloud_workers')}"
    {%- endif %}

    {% if undercloud_heat_convergence is defined -%}
    # The following is configuration for heat convergence feature:
    heat::engine::convergence_engine: {{undercloud_heat_convergence}}
    {%- endif %}
